@@include('include/head.html')
<style>
.aiui-form .aiui-form-item-content{
    margin-left: 90px;
}
.aiui-input,.aiui-select{
    width: 100%;
}
.aiui-form{
    width: 380px;
}
.checkbox-group .aiui-checkbox{
    padding-right: 20px;
}
.checkbox-group .aiui-checkbox+.aiui-checkbox{
    margin-left: 0px;
}
</style>
<div class="aiui-card">
    <div class="aiui-card-header">
        表单组合
    </div>
    <div class="aiui-card-body">
        <form action="" class="aiui-form" aiui-form id="addform" :submit = "aaa" method="GET" disabled="true">
            <div class="aiui-form-item">
                <label class="aiui-form-item-label">权限：</label>
                <div class="aiui-form-item-content">
                    <div id="auth"></div>
                </div>
            </div>
            <div class="aiui-form-item">
                <button class="aiui-btn aiui-btn-primary" type="button" id="dianji">点击</button>
            </div>
        </form>
    </div>
</div>
<script>
aiui.use(['jquery','form','tree'],function($,form,tree){
    var thistree = tree.render({
        ele:'#auth',
        expandAll:true,
        checkboxName:'aaaa',
        data:[{
          id: 1,
          label: '一级 2',
          children: [{
            id: 3,
            label: '二级 2-1',
            children: [{
              id: 4,
              label: '三级 3-1-1'
            }, {
              id: 5,
              label: '三级 3-1-2'
            }]
          }, {
            id: 2,
            label: '二级 2-2',
            children: [{
              id: 6,
              label: '三级 3-2-1'
            }, {
              id: 7,
              label: '三级 3-2-2'
            }]
          }]
        }]
    });
    $('#dianji').on('click',function(e){
      console.log(thistree.getChecked(4));
    })
})
</script>
@@include('include/foot.html')